package com.linsir.service;

import com.linsir.common.base.BaseService;
import com.linsir.model.MetaField;
import com.linsir.model.MetaObject;

import java.util.List;

/**
 * @author yuxiaolin
 * @title: MetaService
 * @projectName linsir-mu
 * @description: 元数据服务
 * @date 2021/12/2 5:58 PM
 */

public class MetaService extends BaseService {

    /**
     * 获取元数据(对象和字段)
     * @param objectCode
     * @return
     */
    public MetaObject getMeta(String objectCode) {
        MetaObject object = MetaObject.dao.getByCode(objectCode);
        List<MetaField> fields = MetaField.dao.queryByObjectCode(objectCode);
        object.setFields(fields);
        return object;
    }
}
